import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
// 引入pinia仓库
import store from './store/index.ts'
import '@/styles/index.scss'
// import 'element-plus/theme-chalk/dark/css-vars.css'
import '@/styles/element/dark/css-vars.css'
// svg插件需要配置代码
import 'virtual:svg-icons-register'
//全局引入
import VxeUI from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css'
import VxeUITable from 'vxe-table'
import 'vxe-table/lib/style.css'

import VxeUIPluginExportXLSX from '@vxe-ui/plugin-export-xlsx'
import ExcelJS from 'exceljs'

(() => {
    if (typeof EventTarget !== "undefined" && EventTarget.prototype.addEventListener) {
        const originalAddEventListener = EventTarget.prototype.addEventListener;
        EventTarget.prototype.addEventListener = function (type, listener, options) {
            if (typeof options === "boolean") {
                options = { capture: options };
            }
            if (typeof options !== "object" || options === null) {
                options = {};
            }
            if (!options.passive) {
                options.passive = false; // 默认设置为 passive
            }
            originalAddEventListener.call(this, type, listener, options);
        };
    }
})();

const app = createApp(App);

app.use(router).use(store);
app.use(VxeUI).use(VxeUITable);
VxeUI.use(VxeUIPluginExportXLSX, {
    ExcelJS
})
//引入鉴权文件
import './permission.ts';
//将应用挂载到挂在节点上
app.mount('#app');
